<%@ include file="/WEB-INF/jsp/include/skin_head.jsp" %><%@ page language="java" pageEncoding="UTF-8" %>
    <div id="pw_bbs_read">
        <div id="pw_bbs_read_header"></div>
        <div class="pw_bbs_read_box">
            <div class="title">
                ${bbs.title}
            </div>
            <div class="user">
                <c:if test="${empty bbs.userNick}">
                <label><spring:message code="bbs.userNick" /></label>
                </c:if> 
                ${bbs.userNick}
                <c:if test="${not empty bbs.userEmail}">
                <img src="<c:url value="/img/skin/default/i_email.gif" />" class="pw_bsc" />
                <span class="email">${bbs.userEmail}</span>
                <span class="pw_eml_red">@</span>
                </c:if>
                <c:if test="${not empty bbs.userHomepage}">
                <img src="<c:url value="/img/skin/default/i_home.gif" />" class="pw_bsc" /> 
                <span class="homepage">${bbs.userHomepage}</span>
                </c:if>
            </div>
            <div>
                <div class="url">
                    <a href="<c:url value="/article/" />${bbs.sid}" class="pw_gray"><spring:message code="DOMAIN" /><c:url value="/article/" />${bbs.sid}</a>
                </div>
                <div class="regdt">
                    ${bbs.registDate} ${bbs.registTime}
                    <br />
                    ${bbs.viewCnt}
                </div>
            </div>
            <div class="content">
                <pre>${bbs.content}</pre>
            </div>
            <c:forEach items="${bbs.fileList}" var="file" varStatus="status">
            <div class="attach">
                ${status.index + 1}. <a href="<c:url value="/download/" />${file.sid}"><b>${file.originalName}</b></a> ${file.fileSize} (${file.downloadCnt} <spring:message code="bbs.download" />)
            </div>
            </c:forEach>
            <div class="moddt">
                <em>${bbs.modifyDate} ${bbs.modifyTime}</em>
                <br />
                <em>${bbs.ip}</em>
            </div>
            <c:if test="${bbsType.rateYn == '1'}">
            <div class="rate">
                <img src="<c:url value="/img/skin/default/i_sum_up.gif" />" class="pw_bsc" /> <span id="rateUp" class="pw_fnt_out">Good</span>
                <img src="<c:url value="/img/skin/default/i_sum_down.gif" />" class="pw_bsc" /> <span id="rateDown" class="pw_fnt_out">Bad</span>
                <span class="pw_rte">
                    <span id="goodCnt">${bbs.goodCnt}</span>
                    (<span id="goodSum">${bbs.goodSum}</span><spring:message code="bbs.aperson" />)
                </span>
            </div>
            </c:if>
            <c:if test="${bbsType.starYn == '1'}">
            <div class="star">
                <img src="<c:url value="/img/skin/default/star_off.gif" />" class="pw_pointer" id="star1" />
                <img src="<c:url value="/img/skin/default/star_off.gif" />" class="pw_pointer" id="star2" />
                <img src="<c:url value="/img/skin/default/star_off.gif" />" class="pw_pointer" id="star3" />
                <img src="<c:url value="/img/skin/default/star_off.gif" />" class="pw_pointer" id="star4" />
                <img src="<c:url value="/img/skin/default/star_off.gif" />" class="pw_pointer" id="star5" />
                <span class="pw_rte">
                    <span id="starCnt">${bbs.starCnt}</span><spring:message code="bbs.aperson" />
                    (<span id="starSum">${bbs.starSum}</span><spring:message code="bbs.point" />)
                </span>
            </div>
            </c:if>
            
            <div class="seperate"></div>

            <div class="memotag">
                <%--<strong>
                    <span id="relation" class="pw_fnt_out"><spring:message code="bbs.relation" /></span>
                    <c:if test="${bbsType.memoYn == '1'}">|</c:if>
                </strong>--%>
                <strong>
                    <span id="memo" class="pw_fnt_out">
                        <spring:message code="bbs.memo" /> ${bbs.memoCnt}<spring:message code="bbs.apiece" />
                    </span>
                    <c:if test="${bbsType.tagYn == '1'}">|</c:if>
                </strong>
                <strong>
                    <span id="tag" class="pw_fnt_out">
                        <spring:message code="bbs.tag" /> ${bbs.tagCnt}<spring:message code="bbs.apiece" />
                    </span>
                </strong>
            </div>
            <c:if test="${bbsType.tagYn == '1'}">
            <div id="tagArea" class="tag">
                <div id="tagInput">
                    <fieldset class="showfieldset">
                        <label for="tagName"><strong><spring:message code="bbs.tag" /></strong></label><br />
                        <div class="pw_padding_w16">
                            <form:input path="tagName" /> <form:errors path="tagName" />
                            <img src="<c:url value="/img/skin/default/btn_tag_save.gif" />" class="pw_pointer" onclick="formSubmit('frmBbs', 'TAG_ADD', 'tagAdd.do')" />
                            <label for="tagName"><spring:message code="bbs.tagDesc" /></label>
                            <br />
                            <c:forEach items="${bbs.tagList}" var="tag" varStatus="status">
                            <c:if test="${not empty tag.tagName}">
                            <span class="pw_tag_out">${tag.tagName}</span> (${tag.hitCnt}) 
                            </c:if>
                            </c:forEach>
                        </div>
                    </fieldset>
                </div>
            </div>
            </c:if>
            <c:if test="${bbsType.memoYn == '1'}">
            <div id="memoArea" class="memo">
                <c:forEach items="${bbs.memoList}" var="memo" varStatus="status">
                <c:if test="${not empty memo.content}">
                <fieldset class="memofieldset" onmouseover="this.style.backgroundColor='#f1f6fb'" onmouseout="this.style.backgroundColor='#fefefe'">
                    <img src="<c:url value="/out/flags/${memo.userCountry}.png" />" class="pw_bsc" />
                    <strong>${memo.userNick}</strong><br />
                    <div class="content"><pre>${memo.content}</pre></div>
                    <span class="ip">
                        <img src="<c:url value="/img/skin/default/i_memo_re.gif" />" class="pw_bsc" title="<spring:message code="bbs.memoReply" />" />
                        <img src="<c:url value="/img/skin/default/i_memo_x.gif" />" class="pw_bsc" title="<spring:message code="bbs.memoRemove" />" />
                        <img src="<c:url value="/img/skin/default/i_bad_off.gif" />" class="pw_bsc" title="<spring:message code="bbs.bad" />" />
                        ${memo.ip}
                    </span>
                    <span class="date" style="clear:both">${memo.modifyDate} ${memo.modifyTime}</span>
                </fieldset>
                </c:if>
                </c:forEach>
                <div id="memoInput">
                    <fieldset class="showfieldset">
                    <sec:authorize ifNotGranted="ROLE_USER">
                        <label for="memoList0.userNick"><strong><spring:message code="bbs.userNick" /></strong></label> 
                        <input type="text" id="memoList0.userNick" name="memoList[0].userNick" size="10" maxlength="32" /> <form:errors path="memoList[0].userNick" />
                        <label for="memoList0.userPasswd"><strong><spring:message code="bbs.userPasswd" /></strong></label>
                        <input type="password" id="memoList0.userPasswd" name="memoList[0].userPasswd" size="10" maxlength="16" /> <form:errors path="memoList[0].userPasswd" />
                    </sec:authorize>
                    <sec:authorize ifAnyGranted="ROLE_USER">
                        <sec:authentication property="principal.username"/>
                    </sec:authorize>
                        <img src="<c:url value="/img/skin/default/btn_memo_save.gif" />" class="pw_pointer" onclick="editFormSubmit('frmBbs', 'content')" />
                    </fieldset>
                    <div id="SAGAEditorBox" style="width: ${(bbsType.bbsWidth - 4 - 20)}px; margin: 10px; height: 225px; z-index: 0; position: relative;" class="WebEditor_box">
                        ${webEditor}
                        <textarea id="content" name="memoList[0].content" cols="75" rows="7" class="WebEditor" style="display: none"></textarea>
                    </div>
                </div>
            </div>
            </c:if>
        </div>
        <div id="subMenuView">
            <a href="<c:url value="/bbs/list/" />${bbs.bbsId}"><img src="<c:url value="/img/skin/default/btn_read_list.gif" />" class="pw_pointer" /></a>
            <img id="addMemo" src="<c:url value="/img/skin/default/btn_read_memo.gif" />" class="pw_pointer" />
            <a href="<c:url value="/bbs/edit.do?bbsId=${bbs.bbsId}&amp;command=ADD" />"><img src="<c:url value="/img/skin/default/btn_read_write.gif" />" class="pw_pointer" /></a>
            <a href="<c:url value="/bbs/reply.do?bbsNo=${bbs.bbsNo}&amp;bbsId=${bbs.bbsId}&amp;command=REPLY" />"><img src="<c:url value="/img/skin/default/btn_read_reply.gif" />" class="pw_pointer" /></a>
            <a href="<c:url value="/bbs/modify.do?bbsNo=${bbs.bbsNo}&amp;bbsId=${bbs.bbsId}&amp;command=MODIFY" />"><img src="<c:url value="/img/skin/default/btn_read_update.gif" />" class="pw_pointer" /></a>
            <a href="<c:url value="/bbs/remove.do?bbsNo=${bbs.bbsNo}&amp;bbsId=${bbs.bbsId}&amp;command=REMOVE" />"><img src="<c:url value="/img/skin/default/btn_read_delete.gif" />" class="pw_pointer" /></a>
            <img id="print" src="<c:url value="/img/skin/default/btn_read_print.gif" />" onclick="printPage('${bbs.bbsNo}');" class="pw_pointer" />
        </div>
    </div>
    
    <c:if test="${bbsType.listYn == '1'}">
    <div class="pw_bbs_read_list">
        <jsp:include page="list.jsp" />
    </div>      
    </c:if> 